﻿/// <reference path="RequestHandler.js" />
/// <reference path="../HttpRequest.js" />
/// <reference path="../../enhancements/QuickCaption.js" />
/// <reference path="../../utilities/Xpcom.js" />
///--------------------------------------------------------------------
/// <file name="ViewForumHandler.js">
///   Adds quick caption to the forums that the current user moderates.
/// </file>
///--------------------------------------------------------------------

NAMFox.ns(function() { with (NAMFox) {

this.ViewForumHandler = function() {
};

ViewForumHandler.prototype = new RequestHandler();
ViewForumHandler.prototype.name = "ViewForumHandler";

ViewForumHandler.prototype.handleRequestCore = function(request, _$) {
    /// <summary>Handles a request.</summary>
    /// <param name="request" type="HttpRequest">
    ///   The HTTP request which encapsulates the
    ///   document and route data for this request.
    /// </param>

    _$("head").append(
        '<link id="namfox-view-thread-css" href="chrome://namfox/skin/view-forum.css" rel="stylesheet" type="text/css" />'
    );
    
    var quickCaption = new QuickCaption(_$, request.htmlDocument, request.routeData.forumId);
    quickCaption.attach();
};

}});